*{box-sizing:border-box}
body{margin:0;font-family:Arial,sans-serif;background:#f4f6f8;color:#222}
header{height:56px;background:#1f2937;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 18px}
main{padding:18px}
button{border:0;background:#2563eb;color:white;padding:8px 12px;border-radius:6px;cursor:pointer}
button.secondary{background:#6b7280}
button.danger{background:#dc2626}
button.small{font-size:11px;padding:5px 8px}
button:disabled{opacity:.45}
a{color:#1d4ed8;text-decoration:none}
.top-bar,.filters,.project-header,.section-box{background:white;border:1px solid #ddd;border-radius:12px;padding:12px;margin-bottom:12px}
.top-bar{display:grid;grid-template-columns:230px 1fr auto;gap:12px;align-items:center}
.user-box{border-right:1px solid #e5e7eb;padding-right:12px}
.project-tabs{display:flex;gap:8px;overflow-x:auto}
.project{padding:9px 12px;border-radius:999px;background:#eef2ff;cursor:pointer;white-space:nowrap}
.project.active{background:#2563eb;color:white}
.project-actions{display:flex;gap:8px;flex-wrap:wrap}
.filters-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.filters label{font-size:12px;font-weight:bold}
.filters input,.filters select{width:100%;padding:7px;border:1px solid #ccc;border-radius:6px;margin-top:4px}
.project-header h2{margin:0 0 4px}
.project-header p{margin:0;color:#555}
.summary{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:16px}
.card-summary{background:white;border:1px solid #ddd;border-radius:10px;padding:14px}
.card-summary strong{display:block;font-size:24px}
.board-wrapper{overflow-x:auto}
.board{display:flex;gap:14px;align-items:flex-start;min-width:max-content}
.column{background:#e5e7eb;border-radius:12px;padding:10px;width:305px;min-height:430px}
.column.drag-over{outline:3px dashed #2563eb}
.column-title{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-bottom:10px}
.count{background:white;border-radius:999px;padding:2px 8px;font-size:12px}
.task-card{background:white;border:1px solid #ddd;border-radius:10px;padding:10px;margin-bottom:9px;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.task-card.dragging{opacity:.45}
.card-top{display:flex;gap:8px;align-items:flex-start}
.drag-handle{cursor:grab;color:#6b7280;font-size:18px;user-select:none;line-height:18px}
.task-title{font-weight:bold;flex:1;font-size:14px;line-height:17px}
.task-meta{font-size:11px;color:#555;margin-top:3px;line-height:15px}
.order-actions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.badge{display:inline-block;padding:4px 7px;border-radius:999px;font-size:11px;font-weight:bold}
.green{background:#dcfce7;color:#166534}
.yellow{background:#fef9c3;color:#854d0e}
.red{background:#fee2e2;color:#991b1b}
.gray{background:#e5e7eb;color:#374151}
.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);align-items:center;justify-content:center;z-index:20}
.modal-content{background:white;border-radius:12px;padding:20px;width:600px;max-width:92vw;max-height:92vh;overflow:auto}
.detail-content{width:760px}
.detail-meta{font-size:13px;color:#374151;line-height:20px}
.detail-body{white-space:pre-wrap;background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;padding:12px;font-size:13px;line-height:18px}
label{display:block;margin-top:12px;font-size:13px;font-weight:bold}
input,select,textarea{width:100%;padding:8px;margin-top:4px;border:1px solid #ccc;border-radius:6px}
textarea{min-height:80px}
.stage-row{display:flex;gap:6px;margin-top:8px;align-items:center;background:#f3f4f6;border:1px solid #ddd;border-radius:8px;padding:6px}
.stage-row.dragging{opacity:.45}
.stage-handle{cursor:grab;font-size:18px;color:#6b7280}
.stage-row input{flex:1}
.gantt{overflow-x:auto}
.gantt-table{min-width:1050px;border-collapse:collapse;width:100%}
.gantt-table th,.gantt-table td{border-bottom:1px solid #e5e7eb;padding:8px;font-size:12px;text-align:left}
.gantt-track{height:24px;background:#eef2ff;border-radius:999px;position:relative;min-width:520px}
.gantt-bar{height:24px;border-radius:999px;position:absolute;top:0;color:white;font-size:11px;text-align:center;line-height:24px;min-width:22px}
.redbar{background:#dc2626}
.yellowbar{background:#ca8a04}
.greenbar{background:#16a34a}
.graybar{background:#6b7280}
.tree ul{padding-left:20px}
.tree li{margin:7px 0}
.footer-note{font-size:12px;color:#6b7280;margin-top:8px}
.otif-panel{background:white;border:1px solid #ddd;border-radius:12px;padding:14px;margin:18px 0}
.otif-header{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}
.otif-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.otif-controls select{padding:7px;border:1px solid #ccc;border-radius:6px}
.otif-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:12px}
.otif-card{border:1px solid #e5e7eb;border-radius:10px;padding:12px;background:#f9fafb}
.otif-card strong{display:block;font-size:24px;margin-bottom:4px}
.otif-table{width:100%;border-collapse:collapse;margin-top:12px}
.otif-table th,.otif-table td{border-bottom:1px solid #e5e7eb;padding:8px;font-size:12px;text-align:left}
.progress{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden}
.progress-bar{height:10px;background:#2563eb;border-radius:999px}
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center}
.login-card{width:420px;background:white;border:1px solid #ddd;border-radius:12px;padding:35px;box-shadow:0 10px 30px rgba(0,0,0,.08)}
.login-card h1{margin-top:0}
.alert{background:#fee2e2;color:#991b1b;padding:10px;border-radius:6px;margin-bottom:15px}
.print-only{display:none}
@media print{
  body.printing-gantt > *:not(.print-only){display:none!important}
  body.printing-gantt .print-only{display:block!important}
  .print-report{font-family:Arial,sans-serif;color:#222;padding:14px}
  .print-report h2{margin:0 0 8px 0}
  .print-report .meta{font-size:12px;margin:4px 0 8px 0}
  .print-report table{width:100%;border-collapse:collapse;font-size:11px}
  .print-report th,.print-report td{border:1px solid #bbb;padding:6px;text-align:left;vertical-align:middle}
  .print-report th{background:#f3f4f6!important}
  .print-track{height:22px;background:#eef2ff!important;border-radius:999px;position:relative;min-width:230px;overflow:hidden}
  .print-bar{height:22px;border-radius:999px;color:white!important;font-size:10px;line-height:22px;text-align:center;min-width:24px}
  .bar-red{background:#dc2626!important}
  .bar-yellow{background:#ca8a04!important}
  .bar-green{background:#16a34a!important}
  .bar-gray{background:#6b7280!important}
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
}
@media(max-width:1100px){
  .top-bar{grid-template-columns:1fr}
  .user-box{border-right:0;border-bottom:1px solid #e5e7eb;padding-bottom:10px}
  .filters-grid{grid-template-columns:repeat(2,1fr)}
  .summary{grid-template-columns:repeat(2,1fr)}
}


.task-full-content{width:1050px}
.task-full-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.task-full-header h3{margin:0 0 6px}
.task-full-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}
.task-full-left,.task-full-right{border:1px solid #e5e7eb;border-radius:10px;padding:14px;background:#fff}
.task-full-left h4,.task-full-right h4{margin:0 0 10px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.modal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
@media(max-width:1100px){.task-full-grid{grid-template-columns:1fr}}
